<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
	<meta charset="utf-8" />
	<title>商城分销系统</title>
	<script th:src="@{/layui/layui.js}" type="text/javascript"></script>
	<link th:href="@{/layui/css/layui.css}" rel="stylesheet" />
	<style>
		.layui-tab-brief>.layui-tab-title .layui-this{
			color: #3f7dff;
		}
		.layui-tab-brief>.layui-tab-title .layui-this:after{
			border-bottom: 3px solid #3f7dff;
		}
		.layui-nav-tree .layui-nav-child dd.layui-this,
		.layui-nav-tree .layui-nav-child dd.layui-this a,
		.layui-nav-tree .layui-this,
		.layui-nav-tree .layui-this>a,
		.layui-nav-tree .layui-this>a:hover {
			background-color: #1e9fff;
			color: #fff;
		}
	</style>
</head>
<body class="layui-layout-admin">
<div class="layui-header layui-bg-blue">

	<div class="layui-logo layui-hide-xs  layui-bg-blue">
		分销商城系统
	</div>
	<ul class="layui-nav layui-layout-left">
		<li class="layui-nav-item">
			<a href="#">
				<i class="layui-icon layui-icon-spread-left"></i>
			</a>
		</li>
	</ul>
	<ul class="layui-nav layui-layout-right">
		<li class="layui-nav-item">
			<a href="#">
				审批任务
				<span class="layui-badge-dot"></span>
			</a>
		</li>
		<li class="layui-nav-item">
			<a href="#">
				通知公告
				<span class="layui-badge">10</span>
			</a>
		</li>
		<li class="layui-nav-item">
			<a href="#">
				<img th:src="@{/img/tiititiitititititititititititititi.gif}" class="layui-nav-img" />管理员
				<dl class="layui-nav-child">
					<dd>
						<a href="#">基本信息</a>
					</dd>
					<dd><a href="#" id="editPassword">密码修改</a></dd>
					<dd><a href="#">安全退出</a></dd>
				</dl>
			</a>
		</li>
	</ul>
</div>

<div class="layui-side layui-bg-black layui-hide-xs">
	<div class="layui-side-scroll">
		<ul class="layui-nav layui-nav-tree">
			<li class="layui-nav-item">
				<a href="javascript:;">商城管理</a>
				<dl class="layui-nav-child">
					<dd><a class="left_menu" menu_id="2" menu_url="/page/category/category" href="javascript:;">商品类目</a></dd>
					<dd><a class="left_menu" menu_id="3" menu_url="/page/brand/brand" href="javascript:;">品牌管理</a></dd>
					<dd><a class="left_menu" menu_id="4" menu_url="/page/goods/region" href="javascript:;">行政区域</a></dd>
				</dl>
			</li>
			<li class="layui-nav-item">
				<a href="javascript:;">商品管理</a>
				<dl class="layui-nav-child">
					<dd><a class="left_menu" menu_id="1472" menu_url="/page/lsl/goodsTable" href="javascript:;">商品列表</a></dd>
					<dd><a class="left_menu" menu_id="1473" menu_url="/page/lsl/goods" href="javascript:;">商品上架</a></dd>
					<dd><a class="left_menu" menu_id="1584" menu_url="/page/goods/goodsRelease" href="javascript:;">商品发布</a></dd>
					<dd><a class="left_menu" menu_id="1594" menu_url="/page/coupons/coupons" href="javascript:;">优惠券管理</a></dd>
					<dd><a class="left_menu" menu_id="1574" menu_url="/page/goods/commentsGroup" href="javascript:;">评论管理</a></dd>
				</dl>
			</li>
			<li class="layui-nav-item">
				<a href="javascript:;">会员管理</a>
				<dl class="layui-nav-child">
					<dd><a class="left_menu" menu_id="112" menu_url="/page/members/members" href="javascript:;">会员列表</a></dd>
					<dd><a class="left_menu" menu_id="113" menu_url="/page/address/address" href="javascript:;">收货地址</a></dd>
					<dd><a class="left_menu" menu_id="114" menu_url="/page/goods/memberCollection" href="javascript:;">会员收藏</a></dd>
					<dd><a class="left_menu" menu_id="104" menu_url="/page/footprint/footprint" href="javascript:;">会员足迹</a></dd>
					<dd><a class="left_menu" menu_id="124" menu_url="/page/goods/history" href="javascript:;">搜索历史</a></dd>
					<dd><a class="left_menu" menu_id="134" menu_url="/page/feedback/feedback" href="javascript:;">意见反馈</a></dd>
				</dl>
			</li>
			<li class="layui-nav-item">
				<a href="javascript:;">订单管理</a>
				<dl class="layui-nav-child">
					<dd><a class="left_menu" menu_id="222" menu_url="/page/order/orderAll" href="javascript:;">全部订单</a></dd>
					<dd><a class="left_menu" menu_id="322" menu_url="/page/order/send" href="javascript:;">待发货订单</a></dd>
					<dd><a class="left_menu" menu_id="422" menu_url="/page/order/paid" href="javascript:;">待支付订单</a></dd>
					<dd><a class="left_menu" menu_id="522" menu_url="/page/order/received" href="javascript:;">待收货订单</a></dd>
					<dd><a class="left_menu" menu_id="223" menu_url="/page/order/exception" href="javascript:;">支付异常订单</a></dd>
					<dd><a class="left_menu" menu_id="224" menu_url="/page/order/retreat" href="javascript:;">退换货订单</a></dd>
					<dd><a class="left_menu" menu_id="334" menu_url="/page/order/refund" href="javascript:;">退款订单</a></dd>
					<dd><a class="left_menu" menu_id="444" menu_url="/page/order/completed" href="javascript:;">已完成订单</a></dd>
				</dl>
			</li>
			<li class="layui-nav-item">
				<a href="javascript:;">钱包管理</a>
				<dl class="layui-nav-child">
					<dd><a class="left_menu" menu_id="12" menu_url="" href="javascript:;">人民币钱包</a></dd>
					<dd><a class="left_menu" menu_id="13" menu_url="" href="javascript:;">积分钱包</a></dd>
				</dl>
			</li>
			<li class="layui-nav-item">
				<a href="javascript:;">财务管理</a>
				<dl class="layui-nav-child">
					<dd><a class="left_menu" menu_id="14" menu_url="" href="javascript:;">充值</a></dd>
					<dd><a class="left_menu" menu_id="15" menu_url="" href="javascript:;">提现</a></dd>
				</dl>
			</li>

			<!--<li class="layui-nav-item">
                <a class="left_menu" menu_id="18" menu_url="" href="javascript:;">任务列表</a>
            </li>
            <li class="layui-nav-item">
                <a class="left_menu" menu_id="19" menu_url="" href="javascript:;">公告管理</a>
            </li>-->
			<li class="layui-nav-item  layui-nav-itemed">
				<a href="javascript:;">系统管理</a>
				<dl class="layui-nav-child">
					<dd><a class="left_menu" menu_id="20" menu_url="/page/system/member" href="javascript:;">系统人员</a></dd>
					<dd><a class="left_menu" menu_id="21" menu_url="/page/system/role" href="javascript:;">角色管理</a></dd>
					<dd><a class="left_menu" menu_id="22" menu_url="/page/system/notice" href="javascript:;">通知公告</a></dd>
					<dd><a class="left_menu" menu_id="23" menu_url="/page/system/log" href="javascript:;">操作日志</a></dd>
					<dd><a class="left_menu" menu_id="241" menu_url="/page/system/mallSet" href="javascript:;">商城配置</a></dd>
					<dd><a class="left_menu" menu_id="24" menu_url="/page/system/sendMessage" href="javascript:;">信息发送</a></dd>
				</dl>
			</li>
			<li class="layui-nav-item">
				<a href="javascript:;">外链</a>
				<dl class="layui-nav-child">
					<dd><a class="left_menu" menu_id="290" menu_url="" href="https://pay.weixin.qq.com/index.php/core/home/login?return_url=%2F" target="_blank;">微信支付</a></dd>
					<dd><a class="left_menu" menu_id="291" menu_url="" href="https://www.alipay.com" target="_blank;">支付宝支付</a></dd>
					<dd><a class="left_menu" menu_id="292" menu_url="" href="https://mpkf.weixin.qq.com" target="_blank;">小程序客服</a></dd>
					<dd><a class="left_menu" menu_id="293" menu_url="" href="https://www.qiniu.com/products/kodo" target="_blank;">七牛云存储</a></dd>
					<dd><a class="left_menu" menu_id="294" menu_url="" href="http://www.kdniao.com/api-track" target="_blank;">快递鸟</a></dd>
				</dl>
			</li>
		</ul>
	</div>
</div>

<div class="layui-body">
	<div lay-filter="head_tabs"  class="layui-tab layui-tab-brief" lay-allowClose="true">
		<ul class="layui-tab-title">
			<li class="layui-this" lay-id="0">系统首页</li>
		</ul>
		<div class="layui-tab-content"
			 style="background-color: #ccc;padding: 10px 20px;">
			<div class="layui-tab-item layui-show">
				<iframe id="iframe0" th:src="@{/page/main}" scrolling="auto"
						style="width: 100%;height: 780px;border: 0px solid #fff;border-radius: 5px;" ></iframe>
			</div>
		</div>
	</div>
</div>
<!--
<div class="layui-footer" style="height: 1px; background-color: #ccc;"></div>-->
<script id="password" type="text/html">
	<div class="layui-bg-black">
		<form class="layui-form"  style="padding: 20px">
			<input type="hidden" value="1" name="id"><!--TODO id为动态-->
			<div class="layui-form-item">
				<label class="layui-form-label">旧密码:</label>
				<div class="layui-input-block">
					<input type="password" name="oldPwd" class="layui-input" lay-verify="required">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">新密码:</label>
				<div class="layui-input-block">
					<input type="password" name="newPwd" class="layui-input" lay-verify="required">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">确认密码:</label>
				<div class="layui-input-block">
					<input type="password" name="confirmPwd" class="layui-input"
						   lay-verify="required|confirmPwd">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">预留手机:</label>
				<div class="layui-input-block">
					<label class="layui-form-label">185****7151</label><!--TODO 手机号码为动态-->
				</div>
			</div>
			<div class="layui-form-item">
				<div class="layui-inline">
					<label class="layui-form-label">短信验证码:</label>
					<div class="layui-input-inline" style="width: 100px;">
						<input type="text" name="code" class="layui-input" maxlength="6" lay-verify="required">
					</div>
				</div>
				<div class="layui-inline">
					<div class="layui-input-inline">
						<a class="layui-btn layui-btn-normal" id="getMobileCode" onclick="getMobileCode()">获取手机验证码</a>
					</div>
				</div>
				<div class="layui-inline" style="display: none">
					<div class="layui-input-inline">
						<a class="layui-btn" id="submitPwd" lay-filter="submitPwd" lay-submit=""></a>
					</div>
				</div>
			</div>
		</form>
	</div>
</script>
<script>
	var $;
	layui.use(['jquery','element','layer','form'],function(){
		$= layui.jquery;
		var ele = layui.element,
				layer = layui.layer,
				form = layui.form;

		setHeight(0);
		removeFirstI();
		form.verify({
			confirmPwd:function (value) {
				if($('input[name="newPwd"]').val()!=value){
					return "两次密码输入不一致";
				}
			}
		})
		//监听头部菜单
		$('#editPassword').on('click',function () {
			layer.open({
				type:1,
				content:$('#password').html(),
				area:'500px',
				offset:'rt',
				anim:1,
				title:'密码修改',
				btn:["确定","取消"],
				btnAlign:'c',
				fixed:true,
				resize:false,
				move:false,
				btn1:function (i,o) {
					$('#submitPwd').click();
				}
			});
		})

		form.on('submit(submitPwd)',function (data) {
			var formData = data.field;
			$.ajax({
				type:'post',
				url:'/system/mc/editPwd',
				data:formData,
				dataType: 'json',
				success:function (result) {
					layer.msg(result.msg);
					if(result.is) {
						layer.closeAll();
					}
				}
			})
		})


		//监听左侧菜单点击
		$('.left_menu').on('click',function(){
			var a = $(this);
			var menu_title = a.text();
			var menu_url = a.attr("menu_url");
			var menu_id = a.attr("menu_id");

			//定义数组
			var ids = [];
			$('.layui-tab-title li').each(function(){
				var layId = $(this).attr('lay-id');
				ids.push(layId);
			});
			let index = $.inArray(menu_id,ids);
			if(index<0){
				ele.tabAdd('head_tabs',{
					title:menu_title,
					id:menu_id,
					content:'<iframe id="iframe'+menu_id+'" src="'+menu_url+'" scrolling="auto" style="width: 100%;height: 780px;border: 0px solid #fff;border-radius: 5px;" ></iframe>'
				})
				setHeight(menu_id);
			}
			removeFirstI();
			ele.tabChange('head_tabs',menu_id);//定位到打开的tab

		})

		//监听tab点击事件
		ele.on('tab(head_tabs)',function(){
			var layId = $(this).attr('lay-id');
			//去掉左侧菜单选中样式
			$('.layui-nav-tree').find('.layui-this').removeClass('layui-this');
			//给对应到的菜单加上样式
			$('.layui-nav-tree').find('a[menu_id="'+layId+'"]').parent().addClass('layui-this');
		})

		//监听i的点击事件
		$('.layui-tab-title li i').toggle('click',function(){
			removeFirstI();
		})



	})
	//获取页面高度
	function setHeight(id){
		var height = window.outerHeight-238;
		$('#iframe'+id).css('height',height);
	}

	function removeFirstI(){
		$('.layui-tab-title li[0]').find("i").remove();
	}

	function topMethod(){
		alert();
	}

	function getMobileCode(){
		var inter="";
		$('#getMobileCode').addClass('layui-disabled');
		var time = 4;
		clearInterval(inter);
		sendCode();//调用发送短信
		inter = window.setInterval(function () {
			time--;
			$('#getMobileCode').html(time+"秒后重新获取");
			if(time==0){
				clearInterval(inter);
				time = 10;
				$('#getMobileCode').removeClass('layui-disabled');
				$('#getMobileCode').html("点击获取验证码");
			}
		},1000);
	}
	function sendCode() {
		var mobiles = [];
		mobiles.push("18577867151");
		$.ajax({
			type:'post',
			url:'/send/sc/sms',
			data:{
				mobiles:mobiles,
				template:1
			},
			dataType:'json',
			success:function (result){
				layer.msg(result.msg);
			}
		})
	}
</script>
</body>
</html>
